<?php

namespace mz\ars;

use Yii;
use yii\data\Pagination;

class Site extends \yii\db\ActiveRecord
{
    # 表名
    public static function tableName()
    {
        return '{{%site}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['title','desc'], 'required'],
            [['logo'], 'string'],
            [['icp', 'desc'], 'string', 'max' => 255],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'title' => 'Title',
            'desc' => 'Desc',
            'icp' => 'Icp',
        ];
    }

    public static function getFindOne()
    {
        $query = static::find()->orderBy('id')->asArray()->one();
        return $query;
    }

}
